<template>
	<view>
		<view class="example-body">
			<uni-nav-bar background-color="#003466" color="#ffffff" :status-bar="true" @click-left="back" left-icon="arrowleft">
				<view class="flex-item">风专业队</view>
			</uni-nav-bar>
		</view>
		<view>
			<view class="team-boss">
				<view class="number-people">分队负责人</view>
				<view class="number" v-for="(item, index) in leader" :key="index">
					<view class="number-logo">
						<image :src="item.imgSrc" mode=""></image>
					</view>
					<view class="number-inf new-infsolid">
						<view class="numbwe-inftop">
							<view class="number-inflogo">
								<image src="../../../static/images/wind-logobox.png" mode=""></image>
							</view>
							<view class="number-infname">{{item.name}}</view>
						</view>
						<view class="numbwe-inftop">
							<view class="number-inflogo">
								<image src="../../../static/images/wind-logotel.png" mode=""></image>
							</view>
							<view class="number-infname">{{item.tel}}</view>
						</view>
					</view>
				</view>
			</view>

			<view class="team-nummber">
				<view class="number-people">分队队员</view>
				<view class="number" v-for="(item, index) in member" :key="index">
					<view class="number-logo">
						<image :src="item.imgSrc" mode=""></image>
					</view>
					<view class="number-inf new-infsolid">
						<view class="numbwe-inftop">
							<view class="number-inflogo">
								<image src="../../../static/images/wind-logobox.png" mode=""></image>
							</view>
							<view class="number-infname">{{item.name}}</view>
						</view>
						<view class="numbwe-inftop">
							<view class="number-inflogo">
								<image src="../../../static/images/wind-logotel.png" mode=""></image>
							</view>
							<view class="number-infname">{{item.tel}}</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import uniNavBar from '@/components/uni-nav-bar/uni-nav-bar.vue';
	import uniIcon from '@/components/uni-icon/uni-icon.vue';
	export default {
		components: {
			uniNavBar,
			uniIcon
		},
		data() {
			return {
				leader: [],
				member: [],
			}
		},
		methods: {
			back() {
				uni.navigateBack({
					delta: 1
				});
			},

			async getWindMember() {
				//风专业队
				let team = {
					teamRowGuid: "ca88e9b8-267b-0faf-d797-6ce23e898aaf"
				}
				await this.$api.TeamMember.ShowTeamData(team).then(res => {
					this.leader = [];
					this.member = [];
					res[1].data.result.forEach(ele => {
						if (ele.isLeader == "是") {
							this.leader.push(ele);
						} else if (ele.isLeader == "否") {
							this.member.push(ele);
						};
						let param = {
						  id: ele.imgSrc
						}
						this.$api.TeamMember.GetDetailById(param).then(res => {
							if (res[1].data.success) {
								ele.imgSrc='http://'+res[1].data.result.filePath
							}
						});
					})
				});
				uni.setStorageSync('windPerson', this.member.length);
			},
		},
		onLoad:async function () {
			await this.getWindMember();
		}
	}
</script>

<style>
	page {
		display: flex;
		flex-direction: column;
		box-sizing: border-box;
		background-color: #F2F2F2;
	}

	.flex-item {
		font-size: 16;
		text-align: center;
	}

	.uni-navbar__header-btns {
		padding: 0;
	}

	.uni-navbar__header-btns:last-child {
		width: 120px;
	}

	.uni-icon {
		padding-left: 42%;
		box-sizing: border-box;
	}

	.uni-navbar__header-btns:last-child {
		width: 120px;
	}

	.team-boss {
		width: 94%;
		background-color: #ffffff;
		border-radius: 3px;
		margin: 0 auto;
		margin-top: 10px;
		overflow: hidden;
	}

	.team-nummber {
		width: 94%;
		background-color: #ffffff;
		border-radius: 3px;
		margin: 0 auto;
		margin-top: 10px;
		overflow: hidden;
	}

	.number-people {
		width: 96%;
		margin: 0 auto;
		font-size: 16px;
		border-bottom: 1px solid #eeeeee;
		color: #333333;
		overflow: hidden;
		padding: 16px 0px;
	}

	.number {
		width: 96%;
		margin: 0 auto;
		overflow: hidden;
		padding: 14px 0px;
	}

	.number-logo {
		width: 50px;
		height: 50px;
		display: flex;
		justify-content: center;
		align-items: center;
		float: left;
		padding-top: 10px;
		padding-bottom: 10px;
	}

	.number-logo image {
		max-width: 100%;
		max-height: 100%;
	}

	.number-inf {
		margin-left: 70px;
	}

	.number-inflogo {
		width: 16px;
		height: 18px;
		display: flex;
		justify-content: center;
		align-items: center;
		float: left;
		margin: 3.5px;
	}

	.number-inflogo image {
		max-width: 100%;
		max-height: 100%;
	}

	.number-infname {
		font-size: 16px;
		color: #333333;
		float: left;
		margin-left: 8px;
	}

	.numbwe-inftop {
		overflow: hidden;
	}

	.new-infsolid {
		width: 93%;
		border-bottom: 1px solid #eeeeee;
		padding-bottom: 10px;
		width: 93%;
		border-bottom: 1px solid #eeeeee;
		padding-bottom: 18px;
		padding-top: 12px;
	}
</style>
